From 8d5e58b632f0be7d1354f4b750efb4604017080e Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Tue, 27 May 2008 22:50:49 +0000 Subject: [PATCH] 106574 - Inconsistent increment behavior for gtkspinbutton MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * gtk/gtkspinbutton.c (gtk_spin_button_real_value_change): Commit the entry text before doing an increment. Patch by Björn Lindqvist. svn path=/trunk/; revision=20196 --- ChangeLog | 8 ++++++++ gtk/gtkspinbutton.c | 10 +++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 021336e0cd..55032e0fa1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-05-27 Matthias Clasen + + 106574 - Inconsistent increment behavior for gtkspinbutton + + * gtk/gtkspinbutton.c (gtk_spin_button_real_value_change): + Commit the entry text before doing an increment. Patch by + Björn Lindqvist. + 2008-05-27 Federico Mena Quintero http://bugzilla.gnome.org/show_bug.cgi?id=533891 - Don't allow diff --git a/gtk/gtkspinbutton.c b/gtk/gtkspinbutton.c index 2218e1e1f0..a9eca0d3ec 100644 --- a/gtk/gtkspinbutton.c +++ b/gtk/gtkspinbutton.c @@ -1266,7 +1266,15 @@ static void gtk_spin_button_real_change_value (GtkSpinButton *spin, GtkScrollType scroll) { - gdouble old_value = spin->adjustment->value; + gdouble old_value; + + /* When the key binding is activated, there may be an outstanding + * value, so we first have to commit what is currently written in + * the spin buttons text entry. See #106574 + */ + gtk_spin_button_update (spin); + + old_value = spin->adjustment->value; /* We don't test whether the entry is editable, since * this key binding conceptually corresponds to changing -- 2.30.2